<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h1>现在是北京时间：</h1>
		<div id="myclock">

		</div>
		<script type="text/javascript">
			function shijian() {
				var today = new Date;
				var year = today.getFullYear(); //年
				var month = today.getMonth() + 1; //月
				var date = today.getDate(); //天
				var day; //星期几
				if (today.getDay() == 0)
					day = "星期日 ";
				if (today.getDay() == 1)
					day = "星期一 ";
				if (today.getDay() == 2)
					day = "星期二 ";
				if (today.getDay() == 3)
					day = "星期三 ";
				if (today.getDay() == 4)
					day = "星期四 ";
				if (today.getDay() == 5)
					day = "星期五 ";
				if (today.getDay() == 6)
					day = "星期六 ";
					var hh = today.getHours(); //小时
				var mm = today.getMinutes(); //分钟
				var ss = today.getSeconds(); //秒
				if(hh<24){
					document.getElementById("myclock").innerHTML =  year + "/" + month + "/" + date +
						" "+ day + " " + hh + ":" + mm + ":" + ss;
				}else if(hh>24){
					hh = hh - 12;
					document.getElementById("myclock").innerHTML =  year + "/" + month + "/" + date +
						" "+ day + " " + hh + ":" + mm + ":" + ss;
				}
				
			}
			setInterval(shijian, 1000);
		</script>
	</body>
</html>